
public class MultiplicativeExpr {
	PrimaryExpr pe;
	MultiplicativeExpr2 me2;
	int lineNum;
	int charPos;
	boolean fromIf;
	
	public MultiplicativeExpr ( PrimaryExpr pe, MultiplicativeExpr2 me2, int line, int charP){
		this.pe = pe;
		this.me2 = me2;
		this.lineNum = line;
		this.charPos = charP;
	}
	public String toString(){
		String ret = "";

		String s = "";
		if (pe != null) {
			s +=  pe.toString();
		}

		if (me2 != null) {
			ret+=" MultiplicativeExpr\n";
			s +=  me2.toString();
		}
		int i =0;
		for(String st: s.split("\n")){
			if(i!=0)
				ret+="\n";
			i++;
			if(st!= "" && me2 !=null)
				ret += "| " + st ;
			if(st!= "" && me2 ==null)
				ret += "" + st ;
		}
		return ret;
	}
	public void check(Type t) throws SemanticException {
		if (pe != null) {
			//System.out.println("in MultiplicativeExpr 1");
			pe.fromIf = this.fromIf;
			pe.check(t);
		}
		if (me2 != null) {
			//System.out.println("in MultiplicativeExpr 2");
			me2.check(t);
		}
	}
}
